﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AppManage.Application.Users.Dtos;
using AppManage.Data.Users;
using AppManage.EntityFramework;
using AppManage.Infrastructure.Repository;
using AutoMapper;
using AutoMapper.Configuration;

namespace AppManage.Application.Users
{
    public class UserService
    {
        private IRepository<User, long> _userRepository;

        SystemManageDbContext db = new SystemManageDbContext();
        public UserService()
        {
            
            _userRepository = new AppManageRepositoryBase<User, long>();
        }

        public UserListDto GetUserList()
        {
            var users = db.Users.ToList();
            var user = _userRepository.GetAll();
            var userList = Mapper.Map<UserListDto>(user);

            return userList;
        }

    }
}
